//
//  CRJ_BaseObject.m
//  BaseProject
//
//  Created by 小崔 on 2022/4/26.
//

#import "CRJ_BaseObject.h"

@implementation CRJ_BaseObject

- (id)mj_newValueFromOldValue:(id)oldValue property:(MJProperty *)property{
    if ([oldValue isKindOfClass:[NSString class]] && [NSString isNull:oldValue]) {// 字符串类型
        return  @"";
    }
    if (oldValue == nil) {
        return @"";
    }
    if ([oldValue isKindOfClass:[NSNull class]]) {// NSNull类型
        if ([property.type.code isEqualToString:@"NSString"]) {
            return  @"";
        }else if ([property.type.code isEqualToString:@"NSArray"]){
            return  @[];
        }
        return  nil;
    }
    return oldValue;
}
// 数组
//+ (NSDictionary *)mj_objectClassInArray{
//    return @{@"list":[Model class]};
//}

// 字段更换
//+ (NSDictionary *)mj_replacedKeyFromPropertyName{
//    return @{@"collectionId":@"id"
//    };
//}

@end
